let parseQueryString = function (url, key) {
    //请在此处编写你的代码，其他部分请勿修改，否则不记分。
    //begin
        var urlRet = /^[^#]+\?(.*)(?:$|#)/.exec(url);
        console.log(urlRet)
        if (!urlRet || !key) {
            return "";
        }
    
        var searchReg = new RegExp("(?:^|&)" + key + "=([^&]*)(&|$)"),
            searchRet = searchReg.exec(urlRet[1]);
        if (searchRet) {
            return decodeURIComponent(searchRet[1])
        } else {
            return "";
        }
    
    
        //end
    // 以下代码请勿修改
    }
console.log(parseQueryString('https://www.didichuxing.com/path?key1=a&key2=123&key_3=key2', 'key2')
)